package Entities;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.*;

public class addListe extends JFrame {
	
	//protected JPanel pnlConteneur_center;
	protected JButton btnValider;
	protected JLabel lblTest;

	public addListe(JPanel main, JPanel pnlConteneurCenter) {
		this.maj(main, pnlConteneurCenter);
	}
	
	public void maj(JPanel pnlConteneur_main, JPanel pnlConteneur_center) {
		
		GridBagConstraints contraintes = new GridBagConstraints();
		
		if(pnlConteneur_center.getComponentCount()>0){
			for(int i=0; i<pnlConteneur_center.getComponentCount(); i++)
			{
				pnlConteneur_center.remove(pnlConteneur_center.getComponent(i));	
			}	
		}
		
		btnValider = new JButton("Valider");
		contraintes.fill = GridBagConstraints.HORIZONTAL;
		contraintes.anchor = GridBagConstraints.NORTH;
		contraintes.weightx = 1.0;
		contraintes.weighty = 1.0;
		contraintes.gridx = 0; // colonne 0 
		contraintes.gridy = 0; // ligne 0
		contraintes.gridwidth = 1; // le composant s'etend sur 1 colonne 
		contraintes.gridheight = 1; // le composant s'etend sur 1 ligne
		pnlConteneur_center.add(btnValider, contraintes);
		

		// Mise a jour des panels

		// Mise a jour des panels

		pnlConteneur_center.validate();
		pnlConteneur_main.validate();
	}

}


